﻿using System.ServiceProcess;

namespace EventScavenger
{
	static class Program
	{
		private const string serviceName = "Event Collector";
		private const string displayName = "Event Collector";
		private const string description = "Event Scavenger collecting service";

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		static void Main(string[] args)
		{
			if (args.Length > 0)
			{
				if (args[0].ToUpper() == "-INSTALL")
				{
					HenIT.Services.ServiceRegister.InstallService(
						System.Reflection.Assembly.GetExecutingAssembly().Location,
						serviceName,
						displayName,
						description);
					return;
				}
				else if (args[0].ToUpper() == "-UNINSTALL")
				{
					HenIT.Services.ServiceRegister.UnInstallService(
						System.Reflection.Assembly.GetExecutingAssembly().Location,
						serviceName);
					return;
				}
			}
			ServiceBase[] ServicesToRun;
			ServicesToRun = new ServiceBase[] 
			{ 
				new EventCollector() 
			};
			ServiceBase.Run(ServicesToRun);
		}
	}
}
